home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / libs / tsipp / tsipp.lha / tsipp3.0a / demos / prismtest.tcl < prev    next >
Encoding:
Text File  |  1992-11-02  |  1.7 KB  |  59 lines

  1. #==============================================================================
  2. #                               prismtest.tcl
  3. #------------------------------------------------------------------------------
  4. # A port of SIPP demo program prismtest.c to Tcl-SIPP.
  5. #------------------------------------------------------------------------------
  6. # $Id: prismtest.tcl,v 2.0 1992/11/02 03:55:31 markd Rel $
  7. #------------------------------------------------------------------------------
  8.  
  9. source util.tcl
  10. ParseArgs
  11.  
  12. #
  13. # Note, there appear to be missing commas in the declarations of these arrays
  14. # in the SIPP demo, the values are been adjusted here so that the resulting
  15. # pictures are the same.
  16. #
  17.  
  18. # The XY coordinats for a 3-sided prism.
  19.  
  20. set prism3 {{ 0.0  0.0}
  21.             {-1.0  2.0} 
  22.             {-2.0 -1.0}}
  23.  
  24. # The XY coordinats for a 5-sided prism.
  25.  
  26. set prism5 {{-0.5  0.0}
  27.             {-1.0  0.5} 
  28.             { 1.0  1.0} 
  29.             {-1.0  2.0} 
  30.             {-2.0  0.5}}
  31.  
  32. SippLightSourceCreate { 1.0  1.0  1.0} {0.9  0.9  0.9} DIRECTION
  33. SippLightSourceCreate {-1.0 -1.0  0.5} {0.4  0.4  0.4} DIRECTION
  34.  
  35. # light salmon
  36.  
  37. set shader [SippShaderBasic 0.5 0.6 0.2 {1.0000 0.6275 0.4784}]
  38.  
  39. # The 3-sided prism.
  40.  
  41. set prism3_obj [SippPrism $prism3 4.0 $shader WORLD]
  42. SippObjectMove $prism3_obj {-3.0 0.0 0.0}
  43. SippObjectAddSubobj WORLD $prism3_obj
  44.  
  45. # The 5-sided prism
  46.  
  47. set prism5_obj [SippPrism $prism5 5.0 $shader WORLD]
  48. SippObjectMove $prism5_obj {3.0 0.0 0.0}
  49. SippObjectAddSubobj WORLD $prism5_obj
  50.  
  51. # The block (a 4 sided prism)
  52.  
  53. SippObjectAddSubobj WORLD [SippBlock {1.0 2.0 3.0} $shader WORLD]
  54.  
  55. SippCameraParams STDCAMERA {5.0 -10.0 6.0} {0.0 0.0 0.0} {0.0 0.0 1.0} 0.4
  56.  
  57. DoRendering "prism"
  58.  
  59.